using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace nDeveloper.TemplateEngine
{
    public class Output
    {
        private string strText;

        public string OutputText
        {
            get
            {
                return strText;
            }
        }

        public void WriteLn(string StringLine)
        {
            if (strText == "")
            {
                strText += StringLine;
            }
            else
            {
                strText += "\r\n" + StringLine;
            }
        }

        public void Write(string String)
        {
            strText += String;
        }

        public void Clear()
        {
            this.strText = "";
        }

        public void Save(string Path)
        {
            if (File.Exists(Path))
            {
                File.Delete(Path);
            }
            StreamWriter a = File.CreateText(Path);
            a.Write(this.strText);
            a.Close();
        }
    }
}
